package leecode

func countKDifference(nums []int, k int) int {
	var result int
	for i := 0; i < len(nums); i++ {
		for j := i + 1; j < len(nums); j++ {
			if nums[j]-nums[i] == k || nums[j]-nums[i] == -k {
				result++
			}
		}
	}
	return result
}
